<h2>Listing Edges for Community <%= session[:community_name] %> </h2>

<table cellspacing = "10">
  <tr>
    <th>Source ID</th>
    <th>Source Name</th>
    <th>Target ID</th>
    <th>Target Name</th>
  </tr>

<% for edge in @edges %>
  <tr>
  <% @sourcename = Node.find( edge.source ) %>
  <td><%=h @sourcename.name %></td>

  <% @targetname = Node.find( edge.target ) %>
  <td><%=h @targetname.name %></td>

  <td><%= link_to 'Edit', :action => 'edit', :id => edge %></td>
  <td><%= link_to 'Destroy', { :action => 'destroy', :id => edge }, :confirm => 'Are you sure?', :method => :post %></td>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @edge_pages.current.previous } if @edge_pages.current.previous %>
<%= link_to 'Next page', { :page => @edge_pages.current.next } if @edge_pages.current.next %>

<br />

<%= link_to 'New edge', :action => 'new' %>
